# -*-encoding: Utf-8 -*-
# author: 黄景涛
# Time：2025/3/12

def f_generator(start, end):
    cur_num = start
    while cur_num < end:
        yield cur_num       # 暂停并返回当前cur_num；  yield作用有二：中断暂停、return返回值
        cur_num += 1


if __name__ == '__main__':
    gen = f_generator(1,10)
    print(f"生成器实例：{gen}")
    for num in gen:
        print(num)
